{include file="public/header" /}

<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-body">
            <fieldset id="searchFieldset_currentTableRenderId" class="table-search-fieldset">
              <legend>条件搜索</legend>
              <form class="layui-form layui-form-pane form-search">
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">状态</label>
                  <div class="layui-input-inline">
                    <select name="status">
                      <option value="">状态</option>
                      <option value="1" {if !empty(input('get.status')) && input('get.status')==1}selected{/if}>待审核
                      </option>
                      <option value="2" {if !empty(input('get.status')) && input('get.status')==2}selected{/if}>审核通过
                      </option>
                      <option value="3" {if !empty(input('get.status')) && input('get.status')==3}selected{/if}>审核驳回
                      </option>
                    </select>
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">主督导</label>
                  <div class="layui-input-inline">
                      <select name="userid" lay-search="">
                          <option value="">督导</option>
                          {foreach $dudao as $k => $v}
                          {if $v.del == 1}
                          <option value="{$v.id}" {if !empty(input('get.userid')) &&
                              input('get.userid')==$v.id}selected{/if}>{$v.account|default=''}{if $v.del !=
                              1}账号已删除{/if}</option>
                          {/if}
                          {/foreach}
                      </select>
                  </div>
                  <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">关键字</label>
                    <div class="layui-input-inline">
                        <input type="text" name="title" placeholder="商铺名称|备注|联系人|联系电话|地址"
                            value="{:input('get.title')}" autocomplete="off" class="layui-input">
                    </div>
                </div>
              </div>
                <div class="layui-form-item layui-inline">
                  <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">
                    搜索
                  </button>
                </div>
              </form>
            </fieldset>
          </div>
          <div class="layui-card-body layui-row layui-col-space10">

            共有数据：<strong id="count">{$list->total()}</strong> 条
          </div>
          <div class="layui-table-body layui-table-main">
            <table class="layui-table">
              <thead>
                <tr>
                  <th>
                    <div class="layui-table-cell">ID</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">申请督导</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">关联订单</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">客户看好门店1</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">客户看好门店1</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">帮客户看好门店</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">状态</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">申请时间</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">操作</div>
                  </th>
                </tr>
              </thead>
              <tbody>
                {foreach $list as $v}
                <tr>
                  <td>
                    <div class="layui-table-cell">{$v.id}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.dudao}</div>
                  </td>
                  <td>
                    {if $v.orderid > 0}
                    <a title="查看任务单" onclick="open_add4('编辑','/shop/shoplist?id={$v.orderid}')" href="javascript:;"
                      class="layui-btn layui-btn-sm">
                      查看任务单
                    </a>
                    {/if}
                  </td>
                  <td>
                    {if !empty($v.datas[0]['mianji'])}
                    <div>面积说明:{if $v.datas[0]['mianji'] == 1}低于60m²{elseif $v.datas[0]['mianji'] == 2}60-80m²{elseif
                      $v.datas[0]['mianji'] == 3}80m²及以上{/if}</div>
                    {/if}
                    {if !empty($v.datas[0]['mentou'])}
                    门头照片:
                    <div id="layer-photos-demo" class="layer-photos-demo">
                      {foreach $v.datas[0]['mentou'] as $m}
                      <img height="40" layer-pid="" layer-src="{$m.url}" src="{$m.url}?x-oss-process=image/resize,h_50" />
                      {/foreach}
                    </div>
                    {/if}
                    {if !empty($v.datas[0]['mentoutext'])}
                    <div>门头说明:{$v.datas[0]['mentoutext']|default=''}</div>
                    {/if}
                    {if !empty($v.datas[0]['shipin'])}
                    门口360旋转视频(匀速、清淅):
                    <div>
                      {foreach $v.datas[0]['shipin'] as $k => $m}
                      <div style="display: inline-block;background-color: aquamarine;"
                        onclick="previewVideo('{$m.url}')">查看视频{$k + 1}</div>
                      {/foreach}
                    </div>
                    {/if}
                    {if !empty($v.datas[0]['shipintext'])}
                    <div>视频说明:{$v.datas[0]['shipintext']|default=''}</div>
                    {/if}
                    <div>详细地址:{$v.datas[0]['getaddress']|default=''}{$v.datas[0]['address']|default='无'}</div>
                  </td>
                  <td>
                    {if !empty($v.datas[1]['mentou'])}
                    门头照片:
                    <div id="layer-photos-demo" class="layer-photos-demo">
                      {foreach $v.datas[1]['mentou'] as $m}
                      <img height="40" layer-pid="" layer-src="{$m.url}" src="{$m.url}?x-oss-process=image/resize,h_50" />
                      {/foreach}
                    </div>
                    {/if}
                    {if !empty($v.datas[1]['mentoutext'])}
                    <div>门头说明:{$v.datas[0]['mentoutext']|default=''}</div>
                    {/if}
                    {if !empty($v.datas[1]['shipin'])}
                    门口360旋转视频(匀速、清淅):
                    <div>
                      {foreach $v.datas[1]['shipin'] as $k => $m}
                      <div style="display: inline-block;background-color: aquamarine;"
                        onclick="previewVideo('{$m.url}')">查看视频{$k + 1}</div>
                      {/foreach}
                    </div>
                    {/if}
                    {if !empty($v.datas[1]['shipintext'])}
                    <div>视频说明:{$v.datas[1]['shipintext']|default=''}</div>
                    {/if}
                    <div>详细地址:{$v.datas[1]['getaddress']|default=''}{$v.datas[1]['address']|default='无'}</div>
                  </td>
                  <td>
                    {if !empty($v.datas[2]['mentou'])}
                    门头照片:
                    <div id="layer-photos-demo" class="layer-photos-demo">
                      {foreach $v.datas[2]['mentou'] as $m}
                      <img height="40" layer-pid="" layer-src="{$m.url}" src="{$m.url}?x-oss-process=image/resize,h_50" />
                      {/foreach}
                    </div>
                    {/if}
                    {if !empty($v.datas[2]['mentoutext'])}
                    <div>门头说明:{$v.datas[2]['mentoutext']|default=''}</div>
                    {/if}
                    {if !empty($v.datas[2]['shipin'])}
                    门口360旋转视频(匀速、清淅):
                    <div>
                      {foreach $v.datas[2]['shipin'] as $k => $m}
                      <div style="display: inline-block;background-color: aquamarine;"
                        onclick="previewVideo('{$m.url}')">查看视频{$k + 1}</div>
                      {/foreach}
                    </div>
                    {/if}
                    {if !empty($v.datas[2]['shipintext'])}
                    <div>视频说明:{$v.datas[2]['shipintext']|default=''}</div>
                    {/if}
                    <div>详细地址:{$v.datas[2]['getaddress']|default=''}{$v.datas[2]['address']|default='无'}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">
                      <div class="layui-table-cell">{if $v.status == 1}待审核{elseif $v.status == 2}通过{else}驳回{/if}</div>
                    </div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.created|default="无"}</div>
                  </td>
                  <td class="layui-table-col-special">
                    {if $v.status == 1}
                    <a title="确认,订单变为选址类型,如非定店类型审核无法通过需要驳回操作"
                      onclick="open_status(this, '/shop/dingorxuan_status', '{$v.id}', 2)" href="javascript:;"
                      class="layui-btn layui-btn-sm layui-bg-blue">
                      通过并标记首选址
                    </a>
                    <a title="确认,订单变为选址类型,如非定店类型审核无法通过需要驳回操作"
                      onclick="open_status(this, '/shop/dingorxuan_status', '{$v.id}', 9)" href="javascript:;"
                      class="layui-btn layui-btn-sm layui-bg-blue">
                      通过并标记二次选址
                    </a>
                    <a title="审核驳回" onclick="promt_alertss('填写驳回理由', '/shop/dingorxuan_status','{$v.id}',3)"
                      href="javascript:;" class="layui-btn layui-btn-sm">
                      审核驳回
                    </a>
                    {else}
                    <div class="layui-table-cell">{if $v.status == 1}待审核{elseif $v.status == 2}通过{else}驳回{/if}</div>
                    {/if}
                  </td>
                </tr>
                {/foreach}
              </tbody>
            </table>
          </div>
          <div class="layui-card-body">
            <div class="page">{$list->render()|raw}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
  {include file="public/footer"}
  <script>
    //视频预览，传url,width,height
    function previewVideo(url, width, height) {
      console.log(url);
      width = width ? width : '65%';
      height = height ? height : '65%';
      let content = '<video width="100%" height="90%"  controls="controls" autobuffer="autobuffer"  autoplay="autoplay" loop="loop">' +
        '<source src="' + url + '" type="video/mp4"></source></video>';
      layer.open({
        type: 1,
        maxmin: true, //打开放大缩小按钮
        title: '视频播放',
        area: [width, height],
        content: content,
      });
    }
    layui.use(['form', 'layer', 'laydate'], function () {
      $ = layui.jquery;
      var laydate = layui.laydate;
      var form = layui.form
        , layer = layui.layer;
      laydate.render({
        elem: '#dates' //指定元素
        , type: 'month'
      });
    });
  </script>
</body>